package com.rwx.myjetpack.musiclist

import com.rwx.myjetpack.domain.Music

/**
 * Created by LH on 2023-05-26.
 * Time: 2023-05-26  10:39
 */
class MusicListModel {
    fun loadMusicByPage(page: Int, size: Int, callback: onMusicLoadResult) {

        val result:ArrayList<Music> = arrayListOf<Music>()
        Thread{

            for (i in (0 until size)){
                Thread.sleep(200)
                result.add(
                    Music(
                    "音乐名称 $i",
                    "音乐封面 $i",
                    "音乐地址 $i")
                )
            }

            callback.onSuccess(result)

        }.start()

    }


    interface onMusicLoadResult{
        fun onSuccess(result:List<Music>)
        fun onFiled(msg:String,code:Int)
    }
}